
function setPageSizeAndSartNum(type) {
    // let startnum=（页数-1）*每一页显示的条数,(pageNum-1)*pageSize
    let pageNum = $("#toPageNum").val();
    pageNum = pageNum == "" ? 1 : parseInt(pageNum);//当转到多少也为空时，默认显示第一页
    pageNum = pageNum == 0 ? 1 : pageNum;

    let pageSize = $("#pageSize").val();
    pageSize = pageSize == "" ? 10 : parseInt(pageSize);
    pageSize = pageSize == 0 ? 1 : pageSize;
    let count = $("#count").html();
    count = parseInt(count);
    let countPage = Math.ceil(count / pageSize);
    switch (type) {
        case "s":
            pageNum = 1;
            break;
        case "--":
            if (pageNum != 1) {
                pageNum--;
            } else {
                alert("已经是第一页了")
            }
            break;
        case "++":
            if (countPage > pageNum) {
                pageNum++;
            } else {
                alert("已经是最后一页了")
            }
            break;
        case "w":
            pageNum = countPage;

            break;
    }
    let startnum = (pageNum - 1) * pageSize;
    getNewsSelectData(startnum, pageSize);
    $("#pageNum").html(pageNum);//查询完成以后需要设置当前页
    $("#toPageNum").val(pageNum);
}